import MixinModel from '@/mixins/MixinModel'

export default {
  mixins: [MixinModel],

  data() {
    return {
      storeModel: 'ResPartner',

      config: {
        path: {
          form: '/erp/partner/form',
          view: '/erp/partner/view'
        },

        propForList: {
          title: rec => {
            return `名称 ${rec.name}`
          },
          label: rec => {
            return ``
          },
          value: rec => {
            return ``
          }
        },

        propForView: [{ web_type: 'field', name: 'name', label: '名称' }],

        titleCreate: '创建',
        titleWrite: '编辑',
        submitBtn: { text: '提交' },

        fieldsForForm: [
          {
            name: 'name',
            type: '',
            label: '名称',
            placeholder: '请填写名称',
            rules: [{ required: true, message: '请填写名称' }]
          }
        ]
      }
    }
  },
  methods: {
    // async init_list() {
    //   console.log(' Mixin init_list partner ')
    //   const action = `${this.storeModel}/search`
    //   await this.$store.dispatch(action, { domain: { customer_rank___gt: 0 } })
    //   const data = this.$store.state[this.storeModel].dataList
    //   console.log('Mixin res,', data)
    // }
  }
}
